/* global  expect, describe, it */

const Admin = require('../api/admin/fn')
const Staff = require('../api/staff/fn')
const iconv = require('iconv-lite')

describe('测试', function() {
  var _id = []
  it('新增', function() {
    var post = Staff.randOne()
    // post.post = iconv.decode(iconv.encode('我们', 'utf8'), 'gbk')
    // console.log(post.post)
    // post.post = encodeURIComponent(post.post)
    // post.post = post.post.toString()
    // var b1 = new Buffer(post.post, 'utf8')
    // console.log(post.post, encodeURIComponent('我们'), 1111)
    // console.log(post)
    return Staff.addOne(post, (data) => {
      console.log(data, 123123)
    })
  })

  return

  it('新增', function() {
    var post = Admin.randOne()
    return Admin.addOne(post, (data) => {
      _id.push(data._id)
    })
  })

  it('批量删除', function() {
    return Admin.removeOne(_id)
  })
})
